<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style type="text/css">
			div {
				width: 400px;
				height: 400px;
				border: 1px solid red;
				background-color: hotpink;
			}
		</style>
	</head>
	<body>
		<div></div>

		<script type="text/javascript">
			
			// 通过开关知道，用户在200ms内点击的次数(奇偶)
			var div = document.querySelector("div"),
				last_click_time = 0,
				is_second = false;
			div.addEventListener("click", function() {
				if(is_second){
					console.log("我是第二次点击")
					is_second = false;
				} else {
					is_second = true;
					setTimeout(function(){
						is_second = false;
					},200)
				}
				
				
				
				
				
				
				
				
				// if(Date.now() - last_click_time < 200){
				// 	console.log("我是双击");
				// }else {
				// 	last_click_time = Date.now();
				// }
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				
				// var time = new Date().toLocaleString();
				// console.log(time.replace(time.slice(time.indexOf(" ") + 1, time.indexOf(" ") + 3),""));
				// console.log(time.replace(/[\u4e00-\u9fa5]/g, ""));
				// console.log(time.replace(/[上下午]/g, ""));
				// console.log(time.replace("上午","").replace("下午",""))
				
				// time = time.split("")
				// time.splice(time.indexOf(" ") + 1, 2)
				// console.log(time.join(""));
				
				// time = time.split(" ");
				// time[1] = time[1].slice(2);
				// console.log(time.join(" "));
			})
		</script>
	</body>
</html>
